package org.idea.spring.ioc.service;

import org.idea.spring.ioc.bean.User;
import org.idea.spring.ioc.dao.UserDao;

/**
 * @Author idea
 * @Date created in 3:35 下午 2020/4/19
 */
public class UserServiceImpl implements UserService{

    private UserDao userDao;

    /**
     * 依赖注入之 setter注入
     * @param userDao
     */
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    /**
     * 依赖注入之 构造器注入
     * @param userDao
     */
    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public User findOne() {
        return userDao.findOne();
    }
}
